module.exports = {
    // 遍历对象
    objForEach: function (obj, fn) {
        let key, result
        for (key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) {
                result = fn.call(obj, key, obj[key])
                if (result === false) {
                    break
                }
            }
        }
    },
    eliminateRedun: (list, filedsName) => {
        let res = [];
        let forEds = [];
        list.forEach(item => {
            let value = forEds[filedsName];
            if (forEds.indexOf(value) < 0) {
                res.push(item);
                forEds.push(value);
            }
        })

        return res;
    }

}
